<?php

namespace App\Exceptions;

use Exception;

class BusinessException extends Exception
{
    protected $code;
    protected $errors;

    public function __construct(string $message = '业务异常', int $code = 400, $errors = [])
    {
        parent::__construct($message);
        $this->code = $code;
        $this->errors = $errors;
    }

    public function getErrors()
    {
        return $this->errors;
    }

    public function getBusinessCode()
    {
        return $this->code;
    }
}
